﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Webapi.EFCore.IService;
using Webapi.EFCore.Model;
using Webapi.EFCore.Model.Enity;

namespace Webapi.EFCore.Web.Controllers
{
    /// <summary>
    /// 角色
    /// </summary>
    public class RoleController : BaseController
    {
        private readonly IRoleService _roleService;

        public RoleController(IRoleService roleService)
        {
            _roleService = roleService;
        }

        /// <summary>
        /// 角色添加
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> Addint(Role role)
        {
            return await _roleService.Addint(role);
        }

        /// <summary>
        /// 角色添加
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<MessageModel<CurdModel>> Add(Role role)
        {
            return await _roleService.Add(role);
        }
    }
}
